<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\backstage\model;
use think\db;
use think\Model;

class GoodsModel extends Model
{

    /*
     * 商品列表
     * */
    public function index($cause)
    {
        $where=$cause;
        $data=DB::name('goods')->where($where)->paginate(10);
        return $data;
    }
    /*
    * 添加商品
    * */
    public function add($array)
    {
        $date['gid']=guid();
        $date['name']=$array['name'];
        $date['spec']=$array['spec'];
        $date['cat']=$array['spec'];
        $date['unit']=$array['spec'];
        $date['pic']=$array['spec'];
        $date['brandid']=$array['spec'];
        $date['market_price']=$array['spec'];
        $date['shop_price']=$array['spec'];
        $date['stock']=$array['spec'];
        $date['sale_count']=$array['spec'];
        $date['goods_desc']=$array['spec'];
        $date['status']=$array['spec'];
        $date['ctime']=$array['spec'];
        $date['spec']=$array['spec'];
        $date['spec']=$array['spec'];

    }
    /*
    * 更改商品
    * */
    public function detail()
    {

    }
    /*
    * 删除类别
    * */
    public function del()
    {

    }


}